package zuoye;

public class SingleDemo {
    public static void main(String[] args) {
        Single s1 = Single.setSingle();
        Single s2 = Single.setSingle();
        System.out.println(s1==s2);
    }
}
class Single{
    private Single(){

    }
    private static Single single;
    public static Single setSingle(){
        if (single==null){
            single=new Single();
        }
        return single;
    }
}
